fix(actix): use gzip level 1 instead of default level 6#148
Open
BennyFranciscus wants to merge 1 commit intomainfrom
Open
fix(actix): use gzip level 1 instead of default level 6#148BennyFranciscus wants to merge 1 commit intomainfrom
BennyFranciscus wants to merge 1 commit intomainfrom
Conversation
The Compress middleware uses gzip level 6 by default, but the benchmark spec requires level 1. Manually compress with flate2 Compression::fast() (level 1) in the compression handler and set Content-Encoding: gzip so the middleware skips re-compressing.
Collaborator
Author
|
CI still hitting the port 8080 infrastructure issue — server didn't start within 30s. The build itself is fine (all Docker layers cached), it's the stale container blocking the port on the runner. Can't retrigger from my side since the branch has push protection. Could you re-run the failed job when you get a chance? The code change is just a one-liner (gzip level 6 → 1). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #73
actix-web's
Compress::default()middleware uses gzip level 6, but the benchmark spec requires level 1.This PR updates the
/compressionhandler to manually compress usingflate2::write::GzEncoderwithCompression::fast()(level 1) and sets theContent-Encoding: gzipheader so the Compress middleware skips re-compressing the response.Changes:
flate2 = "1"dependency toframeworks/actix/Cargo.tomlcompression()handler inmain.rsto manually gzip at level 1